package jass.iss.edu.Properties;

import java.io.IOException;
import java.util.Properties;

public class GeographyDAO  extends PropertiesDAO<GeographyDTO> {

	public GeographyDAO() throws IOException {
		super("geography.properties");

	}

	@Override
	protected GeographyDTO read(Properties pProp, String pID) {
		GeographyDTO geo = new GeographyDTO(pID);			
		geo.setName(pProp.getProperty("Name"+pID));
		geo.setName(pProp.getProperty("Description"+pID));
		return geo;
	}


	@Override
	protected void write(Properties prop, GeographyDTO dto) {
		String strID = dto.getId();
		prop.setProperty( "Name"+strID,  dto.getName());
		prop.setProperty( "Description"+strID,  dto.getDescription());
	}
}
